<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('任务分配')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-post-edit" th:object="${oneItem}">
        <input id="reviewId" name="reviewId" type="hidden" th:field="*{projectId}"/>
        <table width="100%" border="1" cellpadding="0" cellspacing="0" class="mian_b_bg_xz">
            <tr>
                <td colspan="3" class="mian_b_bg_lm">订单详细内容</td>
            </tr>
            <tr>
                <td width="15%" valign="top">项目名称</td>
                <td width="60%" th:text="${oneItem.projectName}">
                </td>
                <td width="20%">&nbsp;</td>
            </tr>
            <tr>
                <td valign="top">订单编号</td>
                <td th:text="${oneItem.orderNumber}">
                </td>
                <td>&nbsp;</td>
            </tr>
            <tr>
                <td colspan="2">客户信息</td>
                <td>&nbsp;</td>
            </tr>
            <tr>
                <td></td>
                <td colspan="3">
                    <table width="100%" border="1" style="border-top:1px solid #fff; border-bottom:1px solid #fff;"
                           cellpadding="0" cellspacing="0" class="mian_b_bg_xz">
                        <tr>
                            <td align="center">客户编号</td>
                            <td align="center">客户名称</td>
                            <td align="center">客户类型</td>
                            <td align="center">联系人</td>
                            <!--<td align="center">职位</td>-->
                            <td align="center">联系方式</td>
                            <!--<td align="center">备注</td>-->
                        </tr>
                        <tr th:if="${client} ne null">
                            <td align="center" th:text="${client.clientId}"></td>
                            <td align="center" th:text="${client.clientName}"></td>
                            <td align="center" th:text="${client.clientType}"></td>
                            <td align="center" th:text="${client.clientContact}"></td>
                            <!--<td align="center" th:text="${client.clientPosition}"></td>-->
                            <td align="center" th:text="${client.clientPhoneNumber}"></td>
                            <!--<td align="center" th:text="${client.clientRemark}"></td>-->
                        </tr>
                        <tr th:if="${client} eq null">
                            <td align="center" th:text="___"></td>
                            <td align="center" th:text="___"></td>
                            <td align="center" th:text="___"></td>
                            <td align="center" th:text="___"></td>
                            <!--<td align="center" th:text="___"></td>-->
                            <td align="center" th:text="___"></td>
                            <!--<td align="center" th:text="___"></td>-->
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td valign="top" colspan="2">项目概况</td>
                <td>&nbsp;</td>
            </tr>
            <tr>
                <td colspan="3">
                    <table width="100%" border="1" style="border-top:1px solid #fff; border-bottom:1px solid #fff;"
                           cellpadding="0" cellspacing="0" class="mian_b_bg_xz">
                        <tr>
                            <td align="center">项目风格</td>
                            <td align="center">地理位置</td>
                            <td align="center">人文环境</td>
                            <td align="center">采光条件</td>
                        </tr>
                        <tr th:if="${oneItem} ne null">
                            <!--<td align="center" th:text="${oneItem.projectContent}"></td>-->
                            <td align="center" th:text="${oneItem.projectStyle}"></td>
                            <td align="center" th:text="${oneItem.projectPosition}"></td>
                            <td align="center" th:text="${oneItem.projectEnvironment}"></td>
                            <td align="center" th:text="${oneItem.projectEnvironment}"></td>

                        </tr>
                        <tr th:if="${oneItem} eq null">
                            <td align="center" th:text="___"></td>
                            <td align="center" th:text="___"></td>
                            <td align="center" th:text="___"></td>
                            <td align="center" th:text="___"></td>
                            <td align="center" th:text="___"></td>
                            <td align="center" th:text="___"></td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td valign="top" colspan="2">项目任务</td>
                <td>&nbsp;</td>
            </tr>
            <!--<td align="center" th:text="${#dates.format(oneItem.projectStartTime,'yyyy-MM-dd')}"></td>-->
            <!--<td align="center" th:text="${#dates.format(oneItem.projectEndTime,'yyyy-MM-dd')}"></td>-->
            <!--<div class="col-sm-8 input-daterange input-group">-->

            <!--</div>-->
            <tr>
                <td colspan="3">
                    <table width="100%" border="1" style="border-top:1px solid #fff; border-bottom:1px solid #fff;"
                           cellpadding="0" cellspacing="0" class="mian_b_bg_xz">
                        <tr>
                            <td align="center">流程名称</td>
                            <td align="center">负责人</td>
                            <td align="center">时间段</td>
                            <td align="center">注意事项</td>
                        </tr>
                        <tr>
                            <td align="center">概念方案设计</td>
                            <td align="center"><select class="form-control" name="leaderId">
                                <option th:each="staffTable:${staffList}" th:value="${staffTable.staffId}"
                                        th:selected="${staffTable.staffId eq oneItem.leaderId}">
                                    [[${staffTable.staffName}]]
                                </option>
                            </select></td>
                            <td align="center">
                                <input type="text" class="input-sm form-control" name="projectStartTime"
                                       placeholder="yyyy-MM-dd"/>
                                <span class="input-group-addon">到</span>
                                <input type="text" class="input-sm form-control" name="projectEndTime"
                                       placeholder="yyyy-MM-dd"/>
                            </td>
                            <td align="center"><input name="projectMoney" class="form-control"/></td>
                        </tr>


                        <tr>
                            <td align="center">深化方案设计</td>
                            <td align="center"><select class="form-control" name="leaderId">
                                <option th:each="staffTable:${staffList}" th:value="${staffTable.staffId}"
                                        th:selected="${staffTable.staffId eq oneItem.leaderId}">
                                    [[${staffTable.staffName}]]
                                </option>
                            </select></td>
                            <td align="center">
                                <input type="text" class="input-sm form-control" name="projectStartTime"
                                       placeholder="yyyy-MM-dd"/>
                                <span class="input-group-addon">到</span>
                                <input type="text" class="input-sm form-control" name="projectEndTime"
                                       placeholder="yyyy-MM-dd"/>
                            </td>
                            <td align="center"><input name="projectMoney" class="form-control"/></td>
                        </tr>


                        <tr>
                            <td align="center">工艺制图</td>
                            <td align="center"><select class="form-control" name="leaderId">
                                <option th:each="staffTable:${staffList}" th:value="${staffTable.staffId}"
                                        th:selected="${staffTable.staffId eq oneItem.leaderId}">
                                    [[${staffTable.staffName}]]
                                </option>
                            </select></td>
                            <td align="center">
                                <input type="text" class="input-sm form-control" name="projectStartTime"
                                       placeholder="yyyy-MM-dd"/>
                                <span class="input-group-addon">到</span>
                                <input type="text" class="input-sm form-control" name="projectEndTime"
                                       placeholder="yyyy-MM-dd"/>
                            </td>
                            <td align="center"><input name="projectMoney" class="form-control"/></td>
                        </tr>


                        <tr>
                            <td align="center">项目执行</td>
                            <td align="center"><select class="form-control" name="leaderId">
                                <option th:each="staffTable:${staffList}" th:value="${staffTable.staffId}"
                                        th:selected="${staffTable.staffId eq oneItem.leaderId}">
                                    [[${staffTable.staffName}]]
                                </option>
                            </select></td>
                            <td align="center">
                                <input type="text" class="input-sm form-control" name="projectStartTime"
                                       placeholder="yyyy-MM-dd"/>
                                <span class="input-group-addon">到</span>
                                <input type="text" class="input-sm form-control" name="projectEndTime"
                                       placeholder="yyyy-MM-dd"/>
                            </td>
                            <td align="center"><input name="projectMoney" class="form-control"/></td>
                        </tr>


                        <tr>
                            <td align="center">项目进项与现场协调</td>
                            <td align="center"><select class="form-control" name="leaderId">
                                <option th:each="staffTable:${staffList}" th:value="${staffTable.staffId}"
                                        th:selected="${staffTable.staffId eq oneItem.leaderId}">
                                    [[${staffTable.staffName}]]
                                </option>
                            </select></td>
                            <td align="center">
                                <input type="text" class="input-sm form-control" name="projectStartTime"
                                       placeholder="yyyy-MM-dd"/>
                                <span class="input-group-addon">到</span>
                                <input type="text" class="input-sm form-control" name="projectEndTime"
                                       placeholder="yyyy-MM-dd"/>
                            </td>
                            <td align="center"><input name="projectMoney" class="form-control"/></td>
                        </tr>


                        <tr>
                            <td align="center">技术支持</td>
                            <td align="center"><select class="form-control" name="leaderId">
                                <option th:each="staffTable:${staffList}" th:value="${staffTable.staffId}"
                                        th:selected="${staffTable.staffId eq oneItem.leaderId}">
                                    [[${staffTable.staffName}]]
                                </option>
                            </select></td>
                            <td align="center">
                                <input type="text" class="input-sm form-control" name="projectStartTime"
                                       placeholder="yyyy-MM-dd"/>
                                <span class="input-group-addon">到</span>
                                <input type="text" class="input-sm form-control" name="projectEndTime"
                                       placeholder="yyyy-MM-dd"/>
                            </td>
                            <td align="center"><input name="projectMoney" class="form-control"/></td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </form>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: datetimepicker-js"/>
<script type="text/javascript">
    var prefix = ctx + "cyq/item/archiving";

    $("#form-post-add").validate({
        onkeyup: false,
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-post-edit').serialize());
        }
    }

    $(function () {
        <!-- laydate示例 -->
        layui.use('laydate', function () {
            var laydate = layui.laydate;
            var startDate = laydate.render({
                elem: '#laydate-startTime',
                max: $('.laydate-endTime').val(),
                theme: 'molv',
                trigger: 'click',
                done: function (value, date) {
                    // 结束时间大于开始时间
                    if (value !== '') {
                        endDate.config.min.year = date.year;
                        endDate.config.min.month = date.month - 1;
                        endDate.config.min.date = date.date;
                    } else {
                        endDate.config.min.year = '';
                        endDate.config.min.month = '';
                        endDate.config.min.date = '';
                    }
                }
            });

            var endDate = laydate.render({
                elem: '#laydate-endTime',
                min: $('.laydate-startTime').val(),
                theme: 'molv',
                trigger: 'click',
                done: function (value, date) {
                    // 开始时间小于结束时间
                    if (value !== '') {
                        startDate.config.max.year = date.year;
                        startDate.config.max.month = date.month - 1;
                        startDate.config.max.date = date.date;
                    } else {
                        startDate.config.max.year = '';
                        startDate.config.max.month = '';
                        startDate.config.max.date = '';
                    }
                }
            });
        });
    });
</script>
</body>
</html>
